﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

using Newtonsoft.Json;

namespace Highchart.Core
{

    public class PointCollection : List<Point>
        {
    public override string ToString()
            {
                var keys = new List<string>();

                foreach (Point serie in this)
                {
                    string ignored = JsonConvert.SerializeObject(serie, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
                    keys.Add(ignored);
                }

                var serialize = string.Join(",", keys.ToArray());
                return serialize;
            }
        }  

}
